<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<div class="job-container">
  <div class="aui-operation">
    <lv-group>
      <a lvDropdownPanelClass="job-resource-dropdown" class="tittle" lv-dropdown [lvDropdownMenus]="options">{{ jobText
        }}
        <i #lvDropdownTrigger lv-icon="lv-icon-triangle-down"></i></a>
    </lv-group>
    <span class="aui-link job-details-btn" [routerLink]="['/insight/jobs']">
      {{ 'common_view_details_label' | i18n }} &gt;
    </span>
  </div>
  <div class="job-chart-container">
    <div id="job-chart"></div>
    <div class="job-tags">
        <div class="job-tag">
          <p class="job-count">
            <i class="status-dot" [ngStyle]="{ background: jobColorConsts.PENDING }"></i>
            <span class="job-count-label">{{ (jobItem[jobStatus.pending.value] < 1000 ? jobItem[jobStatus.pending.value]
                : '999+' ) | nil }}</span>
          </p>
          <p class="aui-text-desc">{{ 'common_pending_label' | i18n }}</p>
        </div>
        <div class="job-tag">
          <p class="job-count">
            <i class="status-dot" [ngStyle]="{ background: jobColorConsts.SUCCESSFUL }"></i>
            <span class="job-count-label">{{
              (jobItem[jobStatus.success.value] < 1000 ? jobItem[jobStatus.success.value] : '999+' ) | nil }}</span>
          </p>
          <p class="aui-text-desc">{{ 'common_success_label' | i18n }}</p>
          <p class="aui-text-desc">/{{'common_partial_success_label' | i18n}}</p>
        </div>
        <div class="job-tag">
          <p class="job-count">
            <i class="status-dot" [ngStyle]="{ background: jobColorConsts.ABORTED }"></i>
            <span class="job-count-label">{{ (jobItem[jobStatus.aborted.value] < 1000 ? jobItem[jobStatus.aborted.value]
                : '999+' ) | nil }}</span>
          </p>
          <p class="aui-text-desc">{{ 'common_job_stopped_label' | i18n }}</p>
        </div>
        <div class="job-tag">
          <p class="job-count">
            <i class="status-dot" [ngStyle]="{ background: jobColorConsts.RUNNING }"></i>
            <span class="job-count-label">{{ (jobItem[jobStatus.running.value] < 1000 ? jobItem[jobStatus.running.value]
                : '999+' ) | nil }}</span>
          </p>
          <p class="aui-text-desc">{{ 'common_running_label' | i18n }}</p>
        </div>
        <div class="job-tag">
          <p class="job-count">
            <i class="status-dot" [ngStyle]="{ background: jobColorConsts.FAILED }"></i>
            <span class="job-count-label">{{ (jobItem[jobStatus.failed.value] < 1000 ? jobItem[jobStatus.failed.value]
                : '999+' ) | nil }}</span>
          </p>
          <p class="aui-text-desc">{{ 'common_fail_label' | i18n }}</p>
        </div>
    </div>
  </div>
</div>
